package com.ecoolex.discount.sales.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import org.springframework.lang.NonNull;

/**
 *
 *   折扣商品-充值<br>
 *<br>
 * 数据表： discount_product_recharge
 *
 */
@Description({"折扣商品-充值"})
public class DiscountProductRecharge implements Serializable {
    /**
     *
     *   产品Id    <br>
     *<br>
     * 字段名： discount_product_recharge.ProductId
     */
    @Description({"产品Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer productId;

    /**
     *
     *   账户输入描述    <br>
     *<br>
     * 字段名： discount_product_recharge.AccountInputDescribe
     */
    @Description({"账户输入描述", "数据长度: 200"})
    private String accountInputDescribe;

    /**
     *
     *   账户输入提示    <br>
     *<br>
     * 字段名： discount_product_recharge.AccountInputPlaceholder
     */
    @Description({"账户输入提示", "数据长度: 50"})
    private String accountInputPlaceholder;

    /**
     *
     *   价格币种    <br>
     *<br>
     * 字段名： discount_product_recharge.CurrencyType
     */
    @Description({"价格币种", "数据长度: 10"})
    private String currencyType;

    /**
     *
     *   价格类型;固定价格;可变价格    <br>
     *<br>
     * 字段名： discount_product_recharge.CounterPriceType
     */
    @Description({"价格类型;固定价格;可变价格", "数据长度: 5"})
    private Integer counterPriceType;

    /**
     *
     *   最大购买数量    <br>
     *<br>
     * 字段名： discount_product_recharge.MaxBuyNumber
     */
    @Description({"最大购买数量", "数据长度: 10"})
    private Integer maxBuyNumber;

    /**
     *
     *   专柜价格    <br>
     *<br>
     * 字段名： discount_product_recharge.CounterPrice
     */
    @Description({"专柜价格", "数据长度: 18"})
    private BigDecimal counterPrice;

    /**
     *
     *   零售价格    <br>
     *<br>
     * 字段名： discount_product_recharge.RetailPrice
     */
    @Description({"零售价格", "数据长度: 18"})
    private BigDecimal retailPrice;

    /**
     *
     *   最小面额    <br>
     *<br>
     * 字段名： discount_product_recharge.MinCounterPrice
     */
    @Description({"最小面额", "数据长度: 18"})
    private BigDecimal minCounterPrice;

    /**
     *
     *   最大面额    <br>
     *<br>
     * 字段名： discount_product_recharge.MaxCounterPrice
     */
    @Description({"最大面额", "数据长度: 18"})
    private BigDecimal maxCounterPrice;

    /**
     *
     *   折扣百分比    <br>
     *<br>
     * 字段名： discount_product_recharge.CounterPriceDiscountPercent
     */
    @Description({"折扣百分比", "数据长度: 18"})
    private BigDecimal counterPriceDiscountPercent;

    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： discount_product_recharge.Deleted
     */
    @Description({"逻辑删除", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean deleted;

    /**
     *
     *   创建用户    <br>
     *<br>
     * 字段名： discount_product_recharge.CreateUser
     */
    @Description({"创建用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String createUser;

    /**
     *
     *   创建时间    <br>
     *<br>
     * 字段名： discount_product_recharge.CreateTime
     */
    @Description({"创建时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date createTime;

    /**
     *
     *   修改用户    <br>
     *<br>
     * 字段名： discount_product_recharge.UpdateUser
     */
    @Description({"修改用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String updateUser;

    /**
     *
     *   修改时间    <br>
     *<br>
     * 字段名： discount_product_recharge.UpdateTime
     */
    @Description({"修改时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * 获取参数<br><br>
     *
     *   产品Id    <br>
     *<br>
     * 字段名： discount_product_recharge.ProductId
     */
    public Integer getProductId() {
        return productId;
    }

    /**
     * 设置参数<br><br>
     *
     *   产品Id<br>
     *<br>
     * 字段名： discount_product_recharge.ProductId
     */
    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    /**
     * 获取参数<br><br>
     *
     *   账户输入描述    <br>
     *<br>
     * 字段名： discount_product_recharge.AccountInputDescribe
     */
    public String getAccountInputDescribe() {
        return accountInputDescribe;
    }

    /**
     * 设置参数<br><br>
     *
     *   账户输入描述<br>
     *<br>
     * 字段名： discount_product_recharge.AccountInputDescribe
     */
    public void setAccountInputDescribe(String accountInputDescribe) {
        this.accountInputDescribe = accountInputDescribe == null ? null : accountInputDescribe.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   账户输入提示    <br>
     *<br>
     * 字段名： discount_product_recharge.AccountInputPlaceholder
     */
    public String getAccountInputPlaceholder() {
        return accountInputPlaceholder;
    }

    /**
     * 设置参数<br><br>
     *
     *   账户输入提示<br>
     *<br>
     * 字段名： discount_product_recharge.AccountInputPlaceholder
     */
    public void setAccountInputPlaceholder(String accountInputPlaceholder) {
        this.accountInputPlaceholder = accountInputPlaceholder == null ? null : accountInputPlaceholder.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   价格币种    <br>
     *<br>
     * 字段名： discount_product_recharge.CurrencyType
     */
    public String getCurrencyType() {
        return currencyType;
    }

    /**
     * 设置参数<br><br>
     *
     *   价格币种<br>
     *<br>
     * 字段名： discount_product_recharge.CurrencyType
     */
    public void setCurrencyType(String currencyType) {
        this.currencyType = currencyType == null ? null : currencyType.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   价格类型;固定价格;可变价格    <br>
     *<br>
     * 字段名： discount_product_recharge.CounterPriceType
     */
    public Integer getCounterPriceType() {
        return counterPriceType;
    }

    /**
     * 设置参数<br><br>
     *
     *   价格类型;固定价格;可变价格<br>
     *<br>
     * 字段名： discount_product_recharge.CounterPriceType
     */
    public void setCounterPriceType(Integer counterPriceType) {
        this.counterPriceType = counterPriceType;
    }

    /**
     * 获取参数<br><br>
     *
     *   最大购买数量    <br>
     *<br>
     * 字段名： discount_product_recharge.MaxBuyNumber
     */
    public Integer getMaxBuyNumber() {
        return maxBuyNumber;
    }

    /**
     * 设置参数<br><br>
     *
     *   最大购买数量<br>
     *<br>
     * 字段名： discount_product_recharge.MaxBuyNumber
     */
    public void setMaxBuyNumber(Integer maxBuyNumber) {
        this.maxBuyNumber = maxBuyNumber;
    }

    /**
     * 获取参数<br><br>
     *
     *   专柜价格    <br>
     *<br>
     * 字段名： discount_product_recharge.CounterPrice
     */
    public BigDecimal getCounterPrice() {
        return counterPrice;
    }

    /**
     * 设置参数<br><br>
     *
     *   专柜价格<br>
     *<br>
     * 字段名： discount_product_recharge.CounterPrice
     */
    public void setCounterPrice(BigDecimal counterPrice) {
        this.counterPrice = counterPrice;
    }

    /**
     * 获取参数<br><br>
     *
     *   零售价格    <br>
     *<br>
     * 字段名： discount_product_recharge.RetailPrice
     */
    public BigDecimal getRetailPrice() {
        return retailPrice;
    }

    /**
     * 设置参数<br><br>
     *
     *   零售价格<br>
     *<br>
     * 字段名： discount_product_recharge.RetailPrice
     */
    public void setRetailPrice(BigDecimal retailPrice) {
        this.retailPrice = retailPrice;
    }

    /**
     * 获取参数<br><br>
     *
     *   最小面额    <br>
     *<br>
     * 字段名： discount_product_recharge.MinCounterPrice
     */
    public BigDecimal getMinCounterPrice() {
        return minCounterPrice;
    }

    /**
     * 设置参数<br><br>
     *
     *   最小面额<br>
     *<br>
     * 字段名： discount_product_recharge.MinCounterPrice
     */
    public void setMinCounterPrice(BigDecimal minCounterPrice) {
        this.minCounterPrice = minCounterPrice;
    }

    /**
     * 获取参数<br><br>
     *
     *   最大面额    <br>
     *<br>
     * 字段名： discount_product_recharge.MaxCounterPrice
     */
    public BigDecimal getMaxCounterPrice() {
        return maxCounterPrice;
    }

    /**
     * 设置参数<br><br>
     *
     *   最大面额<br>
     *<br>
     * 字段名： discount_product_recharge.MaxCounterPrice
     */
    public void setMaxCounterPrice(BigDecimal maxCounterPrice) {
        this.maxCounterPrice = maxCounterPrice;
    }

    /**
     * 获取参数<br><br>
     *
     *   折扣百分比    <br>
     *<br>
     * 字段名： discount_product_recharge.CounterPriceDiscountPercent
     */
    public BigDecimal getCounterPriceDiscountPercent() {
        return counterPriceDiscountPercent;
    }

    /**
     * 设置参数<br><br>
     *
     *   折扣百分比<br>
     *<br>
     * 字段名： discount_product_recharge.CounterPriceDiscountPercent
     */
    public void setCounterPriceDiscountPercent(BigDecimal counterPriceDiscountPercent) {
        this.counterPriceDiscountPercent = counterPriceDiscountPercent;
    }

    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * 获取参数<br><br>
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： discount_product_recharge.Deleted
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置参数<br><br>
     *
     *   逻辑删除<br>
     *<br>
     * 字段名： discount_product_recharge.Deleted
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 获取参数<br><br>
     *
     *   创建用户    <br>
     *<br>
     * 字段名： discount_product_recharge.CreateUser
     */
    public String getCreateUser() {
        return createUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建用户<br>
     *<br>
     * 字段名： discount_product_recharge.CreateUser
     */
    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   创建时间    <br>
     *<br>
     * 字段名： discount_product_recharge.CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建时间<br>
     *<br>
     * 字段名： discount_product_recharge.CreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   修改用户    <br>
     *<br>
     * 字段名： discount_product_recharge.UpdateUser
     */
    public String getUpdateUser() {
        return updateUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改用户<br>
     *<br>
     * 字段名： discount_product_recharge.UpdateUser
     */
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser == null ? null : updateUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   修改时间    <br>
     *<br>
     * 字段名： discount_product_recharge.UpdateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改时间<br>
     *<br>
     * 字段名： discount_product_recharge.UpdateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public enum Deleted {
        NOT_DELETED(new Boolean("false"), "未删除"),
        IS_DELETED(new Boolean("true"), "已删除");

        private final Boolean value;

        private final String name;

        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        public Boolean getValue() {
            return this.value;
        }

        public Boolean value() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    public enum Column {
        productId("ProductId", "productId", "INTEGER", false),
        accountInputDescribe("AccountInputDescribe", "accountInputDescribe", "VARCHAR", false),
        accountInputPlaceholder("AccountInputPlaceholder", "accountInputPlaceholder", "VARCHAR", false),
        currencyType("CurrencyType", "currencyType", "VARCHAR", false),
        counterPriceType("CounterPriceType", "counterPriceType", "INTEGER", false),
        maxBuyNumber("MaxBuyNumber", "maxBuyNumber", "INTEGER", false),
        counterPrice("CounterPrice", "counterPrice", "DECIMAL", false),
        retailPrice("RetailPrice", "retailPrice", "DECIMAL", false),
        minCounterPrice("MinCounterPrice", "minCounterPrice", "DECIMAL", false),
        maxCounterPrice("MaxCounterPrice", "maxCounterPrice", "DECIMAL", false),
        counterPriceDiscountPercent("CounterPriceDiscountPercent", "counterPriceDiscountPercent", "DECIMAL", false),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}